#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <unistd.h>

int main()
{
    pid_t id = fork();
    if (id == 0)
    {
        printf("I am child process\n");
        sleep(5);
        exit(107);
    }
    int status = 0;
    waitpid(id, &status, 0);
    printf("child exit signal:%d, child exit code:%d\n", status & 0x7F, WEXITSTATUS(status));
    return 0;
}
